package com.example.demo.clazz;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.math.MathUtil;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * <pre>
 *  描述:
 * </pre>
 *
 * @author godelgnis(wujiaer)
 * @version 1.0.0
 * @date 2022/1/19 15:47
 */
public class StreamTest {
    public static void main(String[] args) {
        Map<String, Object> map = new HashMap<String, Object>(){{
            put("action", "00");
            put("dateTime", "null");
        }};
        map.entrySet().stream().filter(e -> Objects.nonNull(e.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

        DateTime now = DateTime.now();
        System.out.println(now.second());
        System.out.println(now.minute());
        System.out.println(now.hour(true));
        System.out.println(now.dayOfMonth());
        System.out.println(now.month() + 1);
        System.out.println(now.year());

        LocalDateTime now1 = LocalDateTime.now();
        System.out.println(now1.getSecond());
        System.out.println(now1.getMinute());
        System.out.println(now1.getHour());
        System.out.println(now1.getDayOfMonth());
        System.out.println(now1.getMonth().getValue());
        System.out.println(now1.getYear() % 100);
    }
}
